home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / printing / prplot / prplot.lsp
Text File  |  1990-08-20  |  3KB  |  83 lines

  1. ; PRPLOT.LSP by Brian Carslon
  2. ; Network PRPlot utility
  3. ; This macro must be added to your ACAD.lsp
  4.  
  5. ; You must have a Novell printjob configuration called "CAD" in order for this
  6. ; macro to run. (device = HP, NT, NFF, NA, Bytestream, Banner optional)
  7. ; The "CAPTURE" timeout option is irrelevent since the job goes direct to Queue.
  8. ; I have one HP Laserjet IID and two queues CAD & HP, since CAD files take a
  9. ; while, I setup the seperate queues and gave HP a higher priority.
  10. ; for local printers you could change the "NPRINT" line to COPY fname LPT?:
  11. ;
  12. ; By the way, this macro also asks for next dwg name, then ends after prplot
  13. ; and loads next file for you.
  14.  
  15. (Defun S::STARTUP ()            ;use S::STARTUP to redefine PRPLOT
  16.  (command "UNDEFINE" "END")
  17.  (command "UNDEFINE" "PRPLOT")
  18.  (princ)
  19. )
  20.  
  21. (setq startup nil)
  22.  
  23. (Defun C:PRPLOT ()
  24.  (setvar "cmdecho" 0)
  25.  (prompt "\nSaving file...... ")
  26.  (command "save" "")
  27.  (getppdata)                ;find out next dwg info
  28.  (setq fname (getvar "dwgname")        ;setup filename to U: (users directory)
  29.           lg (strlen fname))
  30.   (if (= ":" (substr fname 2 1))
  31.     (setq fname (strcat "U" (substr fname 2 (- lg 1))))
  32.     (setq fname (strcat "U:" fname))
  33.   )
  34.  (setq file (open "U:PRPLOT.SCR" "w"))
  35.   (write-line ".PRPLOT" file)
  36.   (write-line "D" file)              ; plot display
  37.   (write-line "Y" file)              ; change parameters
  38.   (write-line "Y" file)                  ; plot to file
  39.   (write-line "I" file)              ; units
  40.   (write-line "0,0" file)          ; origin
  41.   (write-line "MAX" file)          ; paper size
  42.   (write-line "Y" file)                    ; rotate 90 degrees
  43.   (write-line "N" file)              ; no hide
  44.   (write-line "F" file)               ; scale to fit
  45.   (write-line fname file)             ; plot file name
  46.   (write-line "" file)                ; return to continue
  47.   (write-line (strcat "NPRINT " (strcat fname ".LST") " JOB=CAD") file) 
  48.   (write-line (strcat "del " fname ".lst") file)  ;delete plot file from disk
  49.  
  50.  (if (= endfile "Y")
  51.     (progn
  52.       (write-line "QUIT" file)
  53.       (write-line "Y" file)
  54.         (if (/= newfile "")
  55.          (progn
  56.            (write-line action file)
  57.            (write-line newfile file)
  58.          )
  59.        (write-line "0" file)
  60.         )
  61.     )
  62.   (write-line "GRAPHSCR" file)
  63.  )
  64.  (close file)
  65.  (command "SCRIPT" "U:PRPLOT")
  66.  (princ)
  67. )
  68.  
  69. (defun getppdata ()
  70.  (initget 1 "Y N")
  71.  (setq endfile (strcase
  72.                  (getkword "\nEND after Printer Plot? <Y or N>  ")))
  73.  
  74.  (if (= endfile "Y")
  75.   (progn
  76.    (setq newfile (strcase
  77.                  (getstring "\nNext Drawing: <none>  ")))
  78.    
  79.    (if (= nil (findfile (strcat newfile ".dwg")))
  80.         (setq action "1") (setq action "2"))
  81.   )
  82.  )
  83. )